cmake_minimum_required(VERSION 3.10)

find_package(Boost COMPONENTS date_time)

include_directories($ENV{DM2016_DEV}/tinyxml/inc ${Boost_INCLUDE_DIRS})
include_directories($ENV{DM2016_DEV})

aux_source_directory(src SRC)

add_library(scada SHARED ${SRC}) 

DB_SELECT(scada)

target_link_libraries(scada options ${Boost_LIBRARIES})

find_package(CxxTest)
if(CXXTEST_FOUND)
    include_directories(${CXXTEST_INCLUDE_DIR})
    enable_testing()
    CXXTEST_ADD_TEST(test_scada test_scada.cpp
    	${CMAKE_CURRENT_SOURCE_DIR}/test/boost_lock.hxx 
		)
	target_link_libraries(test_scada scada)
endif()